﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cos.Core.Model.Content;

namespace Cos.Module.CMS.Data
{
    public interface IElementRepository
    {
        /// <summary>
        /// Gets the element.
        /// </summary>
        /// <param name="elementId">The element id.</param>
        /// <returns>The element</returns>
        Element GetElement(int elementId);

        /// <summary>
        /// Gets the element.
        /// </summary>
        /// <param name="cultureCode">The culture code.</param>
        /// <param name="navId">The nav id.</param>
        /// <param name="partId">The part id.</param>
        /// <returns>The element</returns>
        Element GetElement(string cultureCode, int navId, int partId);

        /// <summary>
        /// Gets the elements of a page.
        /// </summary>
        /// <param name="pageId">The page id.</param>
        /// <returns>The elements</returns>
        IEnumerable<Element> GetElements(int pageId);

        /// <summary>
        /// Gets the elements of a page.
        /// </summary>
        /// <param name="cultureCode">The culture code.</param>
        /// <param name="navId">The nav id.</param>
        /// <returns>The elements</returns>
        IEnumerable<Element> GetElements(string cultureCode, int navId);

        /// <summary>
        /// Saves the element.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <returns>The element</returns>
        Element SaveElement(Element element);
        
        /// <summary>
        /// Deletes the element.
        /// </summary>
        /// <param name="elementId">The element id.</param>
        void DeleteElement(int elementId);
    }
}
